package cn.wolfcode.luowowo.search.serevice.impl;

import cn.wolfcode.luowowo.search.repository.IDestinationSearchRepository;
import cn.wolfcode.luowowo.search.service.IDestinationTemplateService;
import cn.wolfcode.luowowo.search.template.DestinationTemplate;
import com.alibaba.dubbo.config.annotation.Service;
import org.elasticsearch.client.ElasticsearchClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;

@Service
public class DestinationTemplateServiceImpl implements IDestinationTemplateService {
    @Autowired
    private ElasticsearchTemplate template;

    @Autowired
    private IDestinationSearchRepository repository;

    @Autowired
    private ElasticsearchClient client;

    @Override
    public void save(DestinationTemplate t) {
        repository.save(t);
    }

    @Override
    public DestinationTemplate findByName(String keyword) {

        return repository.findByName(keyword);
    }

}
